package com.glory.wxelectricitypda.fragment;


import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.widget.FrameLayout;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.glory.wxelectricitypda.R;
import com.glory.wxelectricitypda.adapter.PackagedAdapter;
import com.glory.wxelectricitypda.adapter.UnpackagedAdapter;
import com.pda.platform.ui.ui_pdaplatform.base.FreeUI_BaseFragment;
import com.pda.platform.ui.ui_pdaplatform.entity.FreeUI_AddViewEntity;

import butterknife.BindView;


public class PackagedFragment extends FreeUI_BaseFragment {

    @BindView(R.id.llMain)
    FrameLayout llMain;
    @BindView(R.id.packagedRecycler)
    RecyclerView packagedRecycler;
    public PackagedAdapter mPackagedAdapter;

    public PackagedFragment() {
    }

    @Override
    protected int getLayoutResId() {
        return R.layout.fragment_packaged;
    }

    @Override
    protected void initView() {
        packagedRecycler.setLayoutManager(new LinearLayoutManager(getActivity()));
        packagedRecycler.setItemAnimator(new DefaultItemAnimator());
        packagedRecycler.addItemDecoration(new DividerItemDecoration(getActivity(), 1));
        mPackagedAdapter = new PackagedAdapter(null);
        mPackagedAdapter.openLoadAnimation(BaseQuickAdapter.ALPHAIN);
        mPackagedAdapter.isFirstOnly(true);
        packagedRecycler.setAdapter(mPackagedAdapter);
    }

    @Override
    protected void initData() {

    }

    public void addData(String packBean){
        mPackagedAdapter.addData(packBean);
    }

    @Override
    protected FreeUI_AddViewEntity getBaseEntity() {
        return null;
    }
}